/**
  * @Description: WoShop商城
  * @Author: 梧桐
  * @Copyright: 武汉一一零七科技有限公司©版权所有
  * @Link: www.wo-shop.net
  * @Contact: QQ:2487937004
  */
<template>
    <view class="index_class">
        <view class="myrecord" hover-class="click-active-bgc" v-for="(item,index) in recordList" :key="index" @click="getnav('/pagesC/wallet/withdrawDetail?tx_id=' + item.id)">
			<view class="color">{{item.type_name}}{{$t('￥')}}{{item.price}}</view>
            <view>
				<view v-if="item.complete == 0">
					<view class="title" v-if="item.checked == 0 ">{{$t('等待审核')}}</view>
					<view class="title" v-if="item.checked == 1 ">{{$t('审核通过')}}</view>
					<view class="title" v-if="item.checked == 2 ">{{$t('审核拒绝')}}</view>
				</view>
				<view class="title" v-if="item.complete == 1 ">{{$t('打款成功')}}</view>
				<view class="title" v-if="item.complete == 2 ">{{$t('打款失败')}}</view>
                <view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM')}}</view>
            </view>
            
        </view>
		<u-empty v-if="recordList.length===0"  :src="STATICURL+'images/nullStatus/noList.png'" margin-top="200" icon-size="300"  :text="$t('暂无数据')"></u-empty>
      <loadMore :loadingType="loadingType"></loadMore>
    </view>
</template>

<script>
let page = 1
export default {
    onLoad(){
        page = 1
        this.getWithdrawList()
      uni.setNavigationBarTitle({
        title:this.$t('提现记录')
      });
    },
    data(){
        return {
            recordList:[],
            loadingType:0
        }
    },
    onReachBottom:function(){
        // 上拉加载更多
        if(this.loadingType == 1 || this.loadingType == 2) { return false }
        this.loadingType = 1

        page++
        this.getWithdrawList()
	},
    methods: {
        getWithdrawList(){
            this.$http.getWithdrawList({page:page}).then(res=>{
                if(res.status == 200) {
                    if(res.data.length == 0) {
                        this.loadingType = 2
                    }
                    this.recordList = [...this.recordList,...res.data]
                    this.loadingType = 0
                }
            })
        }
    },
}
</script>

<style>

</style>
